package collection;

import java.util.ArrayList;
import java.util.ListIterator;

public class ListIteratorTest {
	public static void main(String[] args) {
		ArrayList<String> al = new ArrayList<String>();
		al.add("rajeev");
		al.add("vibhanshu");
		al.add("Jheene");
		al.add("sitanshu");
		System.out.println("element of thired position -" +al.get(2));
		ListIterator<String> itr = al.listIterator();
		while(itr.hasNext()){
			System.out.println(itr.next());
		}
		System.out.println("your priveous order name-");
		while(itr.hasPrevious()){
			System.out.println(itr.previous());
		}
	}

}
